#ifndef GAMECONSTANTS_H
#define GAMECONSTANTS_H
#include <vector>
#include <QString>

// enums
enum PlayerType{ HOST = 0, CLIENT = 1 };
enum MonkeySide { LEFT = -1, RIGHT = 1 };
enum Direction { UP = -1, DOWN = 1 };       // for monkeys
enum Type { MONKEY = 0, BANANA = 1, COCONUT = 2 };
enum GameMode { SINGLE = 0, NETWORK = 1, LOCAL = 2 };
enum Difficulty { CHEAT = 0, EASY = 1, MEDIUM = 2, HARD = 3, IMPOSSIBLE = 4 };

// Geometry:
const int COCO_HEIGHT = 35;
const int COCO_WIDTH = 35;
const int COCO_X_OFFSET = 30;   // offset of coconut position (where coconut
const int COCO_Y_OFFSET = 30;   // spawns when monkey shoots) relative to monkey
const int BANANA_HEIGHT = 35;
const int BANANA_WIDTH = 35;
const int BANANA_DISTANCE_FROM_BORDER = 160;
const int MONKEY_HEIGHEST_POINT = 70;       // Y coordinate of highest point the monkey can climb
const int MONKEY_LOWEST_POINT = 420;        // Y coordinate of lowest point the monkey can climb (top coordinate of monkey)
const int MONKEY_DISTANCE_FROM_BORDER = 74;
const int MONKEY_HEIGHT = 101;
const int MONKEY_WIDTH = 78;
const int GRASS_START = 498;   // Y coordinate of where the green label starts (upper coord.)
const int GRASS_END = 559;     // Y coordinate of where the green label ends (lower coord.)
const int WORLD_WIDTH = 900;
const int SUN_MAX_Y = 100; // highest y-coord where sun can be
const int SUN_CIRCLE_RADIUS = 700;

// Game parameters:
extern Difficulty _difficulty_;   // for the following vectors, the first value is for difficulty level cheat,
                                // the 2nd is difficulty level easy, the 3rd is medium, and the 4th is for hard.
const int MAIN_TIMER_UPDATE_INTERVAL = 30;      // in ms
const std::vector<int> MIN_BANANA_INTERVAL = { 100, 1000, 700, 500, 300 };    // minimum time between 2 bananas coming down in ms
const std::vector<int> MAX_BANANA_INTERVAL = { 800, 2000, 1500, 1400, 900 };  // maximum time between 2 bananas coming down in ms

const std::vector<int> COCO_SPEED = { 12, 10, 12, 15, 20 };                      // #pixels it is moved each frame
const std::vector<int> MONKEY_CLIMBING_SPEED = { 16, 15, 14, 13, 17 };        // # pixels moved every second(!) frame
const int MONKEY_FALLING_SPEED = 15;                                      // # pixels moved every frame
const std::vector<int> MIN_BANANA_SPEED = { 1, 1, 2, 2, 4 };                 // min # pixels moved each frame
const std::vector<int> MAX_BANANA_SPEED = { 4, 3, 4, 5, 7 };                 // max # pixels moved each frame
const std::vector<int> COCO_SHOOT_INTERVAL = { 0, 1700, 1400, 800, 500 };          // ms to wait until next coconut can be shot
const std::vector<int> AI_MIN_ADD_COCO_SHOOT_INTERVAL = { 1000, 800, 100, 0, 0 }; //min #ms the AI waits longer than he would have to
const std::vector<int> AI_MAX_ADD_COCO_SHOOT_INTERVAL = { 4000, 2000, 600, 400, 0 }; //max #ms the AI waits longer than he would have to
const std::vector<int> AI_AIM_FOR_OPPONENT = { 1, 60, 30, 20, 60 };    // number of times out of 100 the AI tries to hit the other monkey

// images
const std::vector<QString> LEFT_MONKEY_FRAMES = { "player1monkey1.png",
                                                  "player1monkey2.png",
                                                  "player1monkey3.png",
                                                  "player1monkey4.png" };
const std::vector<QString> RIGHT_MONKEY_FRAMES = { "player2monkey1.png",
                                                   "player2monkey2.png",
                                                   "player2monkey3.png",
                                                   "player2monkey4.png" };
const std::vector<QString> LEFT_MONKEY_FALLING_FRAMES = { "player1monkey2.png" };
const std::vector<QString> RIGHT_MONKEY_FALLING_FRAMES = { "player2monkey2.png" };
const std::vector<QString> BANANA1_FRAMES = { "banana1.png" };
const std::vector<QString> BANANA2_FRAMES = { "banana2.png" };
const std::vector<QString> BANANA3_FRAMES = { "banana3.png" };
const std::vector<QString> COCONUT_FRAMES = { "coconut.png" };

// default names
const std::vector<QString> DEFNAMES = {
    "Meldrik", "Leo", "Gabe", "Lynx", "Bardrick", "Boyden", "Brion", "Drudle", "Harvey",
    "Brice", "Dennys", "Whisper", "Geoffrey", "Henry", "Agamore", "Hubert", "Rufus",
    "Wyatt", "Octo", "Bryce", "Archibald", "Naners", "Mohawk", "Skywalker", "Lamond",
    "Hillocke", "Banner", "Olson", "Quinn", "Ami", "Kealy", "Ezrah", "Dangles", "Wayne",
    "Peanut", "Griffin", "Anderson", "Stanley", "Forba", "Garafeld", "Dalon", "Toland",
    "Tumbles", "Caelan", "Edmund", "Cort", "Dribble", "Cadman", "Gadget", "Digits",
    "Clifford", "Norman", "Owyn", "Burgess", "Benkamin", "Tobias", "Eldwin", "Frank",
    "Hansel", "Morgan", "Tarzan", "Grissom", "Finian", "Tom", "Maveen", "Criss", "Coco",
    "Bursone", "Jakson", "Dillon", "Einhard", "FitJames", "Quinley", "Powell", "Caldwell",
    "Fred", "Moryn", "Hoodwink", "Beckham", "Brand", "Rally", "Monte", "Kearne", "Gizmo",
    "Aviel", "Warth", "Durand", "Millard", "Edan", "Ulrich", "Charles", "Copper", "Eddrick",
    "Zaine", "Boomer", "Hamlet", "Steven", "Cheeks", "Hamlin", "Monty", "Colten", "Jovan",
    "Zack", "Whitey", "Jasper", "Hutch", "Gaven", "Torrey", "Brian", "Blake", "Stinky",
    "Damon", "Silver", "Doug", "Colt", "Jackson", "Nick", "Sheridan", "Hanz", "Bean",
    "Eston", "Heston", "Edwin", "Moose", "Baldrick", "Dever", "Randell"
};

// default chat messages (if user hits enter without entering a message)
const std::vector<QString> DEFMESSAGES = {
    "I think Green Battle is awesome!",
    "Hey, let's do a game!",
    "Yes, you're right.",
    "Just wanted to say hi.",
    "The other night I dreamt I was in Monkeyland.",
    "Let's throw some coconuts!",
    "Yippee!!!",
    "Are you still there?",
    "Is it normal that bananas are falling down the sky?",
    "I'll be a monkey's uncle!",
    "This is more fun than a barrel of monkeys!"
};

#endif // GAMECONSTANTS_H
